﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "opencv2/core/core.hpp"
#include "videoitem.h"
#include <QElapsedTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    QList<QString> word_list;
    void create_video_thread(VideoItem *item, unsigned long long core);

private:
    Ui::Widget *ui;

    QString output_dir;
    int frame_count;
    QTimer *player_timer;
    QList<VideoItem *> video_item_list;
    qsizetype cores_number;  // 记录本电脑有多少个核心
    QElapsedTimer time;

    void dragEnterEvent(QDragEnterEvent *);
    void dropEvent(QDropEvent *);

signals:
    void start_next_thread(unsigned long long core);
};
#endif // WIDGET_H
